import requests
filename=input('请选择上传文件:')
# 强烈建议使用二进制模式打开文件,+b
# files = {'file':open(filename, 'rb')}
with open(filename,'rb') as f:
    requests.post('http://localhost:5000', data=f)
uploadres=requests.post('http://127.0.0.1:5000/upload')
print(uploadres)